{include file="common/top" /}

<div style="padding: 20px;background: #ffffff;" >
	<form class="layui-form " action="">
	<div class="layui-form-item">
		<label class="layui-form-label">*运营名称：</label>
		<div class="layui-col-xs4">
			<select name="operate_id"  autocomplete="off" lay-filter="aihao">
				<option value="">请选择运营</option>
				{volist name="acc_list" id='vo'}
					<option value="{$vo.id}">{$vo.username}</option>
				{/volist}
			</select>
		</div>
	</div>
	<div class="layui-form-item">
        <label class="layui-form-label">*任务日期：</label>
		<div class="layui-col-xs4">
            <input type="text" name="time" id="date" placeholder="请选择时间" lay-verify="required" autocomplete="off" class="layui-input">
		</div>
		<label class="layui-form-label">*任务：</label>
		<div class="layui-col-xs4">
            <input type="text" name="yeji" lay-verify="required" autocomplete="off" placeholder="请输入业绩" class="layui-input">
		</div>
	</div>
	<hr />
	<div class="layui-form-item">
		<div class="layui-input-block">
			<button class="layui-btn"  lay-submit="" lay-filter="demo1">添加</button>
		</div>
	</div>
	
	</form>
	
</div>
{include file="common/footer" /}
<script>
	var form ,layer ,$ ;
	layui.use(['form', 'layedit', 'laydate'], function(){
        form = layui.form ,layer = layui.layer ,$ = layui.$,laydate = layui.laydate;
        laydate.render({
		    elem: '#date' //指定元素
            ,type: 'month'
		  });
        //监听提交
        form.on('submit(demo1)', function(data){
            var articleFrom = data.field;
            layer.load(1, { shade : [ 0.5, '#676a6c' ] });
            $.post("{:url('yeji_add')}?t=json",articleFrom,function(data){
                layer.closeAll();
                if (data['code'] == 1) {
                    var index1 = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(index1); //再执行关闭 
                    //父页面数据 ，重新加载
                    parent.get_s(data['msg']);

                } else {
                    layer.msg(data['msg'], { icon : 5 });
                }
            });
            return false;
        });
	});
	
	
</script>
